1 var tooltipID='osdhtmltooltip';var imgtipID='osdhtmlpointer';document.write('<div id="'+tooltipID+'" style="VISIBILITY: hidden;"></div>');document.write('<img id="'+imgtipID+'" style="VISIBILITY: hidden;" src="http://15giay.vn/images/oTooltiparrow.gif">');var offsetfromcursorX=12;var offsetfromcursorY=10;var offsetdivfrompointerX=10;var offsetdivfrompointerY=14;var ie=document.all;var ns6=document.getElementById&&!document.all;var enabletip=false;if(ie||ns6)
2 var
tipobj=document.getElementById(tooltipID);var pointerobj=document.getElementById(imgtipID);function ietruebody(){return(document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body;}
3 function showtip(thetext,thewidth,thecolor){
try{if(!tipobj.style)
4 return
;if(ns6||ie){if(thewidth)
5 tipobj.style.width=thewidth+
"px";if(thecolor&&thecolor!="")
6 tipobj.style.backgroundColor=thecolor;tipobj.innerHTML=thetext;enabletip=
true;return false;}}
7 catch
(e)
8 {}}
9 function positiontip(e){
if(!tipobj.style)
10 return
;if(enabletip&&pointerobj){var nondefaultpos=false;var curX=(ns6)?e.pageX:event.clientX+ietruebody().scrollLeft;var curY=(ns6)?e.pageY:event.clientY+ietruebody().scrollTop;var winwidth=ie&&!window.opera?ietruebody().clientWidth:window.innerWidth-20;var winheight=ie&&!window.opera?ietruebody().clientHeight:window.innerHeight-20;var rightedge=ie&&!window.opera?winwidth-event.clientX-offsetfromcursorX:winwidth-e.clientX-offsetfromcursorX;var bottomedge=ie&&!window.opera?winheight-event.clientY-offsetfromcursorY:winheight-e.clientY-offsetfromcursorY;var leftedge=(offsetfromcursorX<0)?offsetfromcursorX*(-1):-1000;if(rightedge<tipobj.offsetWidth){tipobj.style.left=curX-tipobj.offsetWidth+"px";nondefaultpos=true;}
11 else
if(curX<leftedge)
12 tipobj.style.left=
"5px";else{tipobj.style.left=curX+offsetfromcursorX-offsetdivfrompointerX+"px";pointerobj.style.left=curX+offsetfromcursorX+"px";}
13 if
(bottomedge<tipobj.offsetHeight){tipobj.style.top=curY-tipobj.offsetHeight-offsetfromcursorY+"px";nondefaultpos=true;}
14 else
{tipobj.style.top=curY+offsetfromcursorY+offsetdivfrompointerY+"px";pointerobj.style.top=curY+offsetfromcursorY+"px";}
15 tipobj.style.visibility=
"visible";if(!nondefaultpos)
16 pointerobj.style.visibility=
"visible";else
17 pointerobj.style.visibility=
"hidden";}}
18 function hidetip(){
if(!tipobj.style)
19 return
;if(ns6||ie){enabletip=false;tipobj.style.visibility="hidden";pointerobj.style.visibility="hidden";tipobj.style.left="-1000px";tipobj.style.backgroundColor='';tipobj.style.width='';}}
20 document.onmousemove=positiontip;



Full source code website bán hàng thương mại điện tử gần giống shopee 469.166 lượt xem

Gõ tìm kiếm nhanh...